﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wijmo.Master" AutoEventWireup="true" CodeBehind="Columns.aspx.cs" Inherits="ControlExplorer.C1GridView.Columns" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.3" Namespace="C1.Web.Wijmo.Controls.C1GridView" TagPrefix="wijmo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
    <style type="text/css">
        legend
        {
            background-color: transparent;
        }
        .style1
        {
            font-style: normal;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager runat="server" ID="ScriptManager1" />
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <wijmo:C1GridView ID="C1GridView1" runat="server" DataSourceID="SqlDataSource1" ScrollMode="Auto"
                AutoGenerateColumns="false" ShowRowHeader="true" AllowColMoving="true" AllowSorting="true">
                <Columns>
                    <wijmo:C1BoundField DataField="OrderID" HeaderText="ID" SortExpression="OrderID" DataFormatString="d"/>
                    <wijmo:C1BoundField DataField="ShipName" HeaderText="发货源" SortExpression="ShipName" />
                    <wijmo:C1BoundField DataField="ShipCity" HeaderText="发货城市" SortExpression="ShipCity"/>
                    <wijmo:C1Band HeaderText="日期">
                        <Columns>
                            <wijmo:C1BoundField DataField="OrderDate" HeaderText="订单日期" DataFormatString="d" SortExpression="OrderDate" />
                            <wijmo:C1BoundField DataField="RequiredDate" HeaderText="需要日期" DataFormatString="d" SortExpression="RequiredDate" />
                            <wijmo:C1BoundField DataField="ShippedDate" HeaderText="发货日期" DataFormatString="d" SortExpression="ShippedDate" />
                        </Columns>
                    </wijmo:C1Band>
                </Columns>
            </wijmo:C1GridView>
        </ContentTemplate>
    </asp:UpdatePanel>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\C1NWind.mdb;Persist Security Info=True"
        ProviderName="System.Data.OleDb" SelectCommand="SELECT TOP 10 [OrderID], [ShipName], [ShipCity], [OrderDate], [RequiredDate], [ShippedDate] FROM ORDERS">
    </asp:SqlDataSource>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Description" runat="server">
    <p>
      此示例演示如何使用带将列标题组织成一个层次结构。
     它也说明您如何排序列，并使用drag-n-drop去重新排列列。
    </p>

    <p>
       在此示例中使用以下的列属性和技术：
    </p>
    <ul>
        <li><strong>AllowColMoving</strong> - 用drag-n-drop重排序列</li>
        <li><strong>AllowSorting</strong> - 去排序列.</li>
        <li>The <span class="style1"><em><strong>OrderDate</strong></em></span>, <strong>RequiredDate</strong>, and 
            位于 <strong>C1Band</strong>的<strong>ShippedDate </strong>列来组织多列头</li>
    </ul>

    <p>
       单击列标题按该列排序。
    </p>
    <p>
       目标列头拖到源列标题来移动一列。列可以被插入目标列的左侧或右侧，列头间的插入点用箭头表示。
       添加一个列到带，该列应该位于带状头中心。
    </p>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ControlOptions" runat="server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <fieldset>
                <legend>列设置</legend>
                <asp:CheckBox ID="CheckBox4" runat="server" AutoPostBack="true" Text="显示行标题"
                    Checked="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
                <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" Text="允许列移动"
                    Checked="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
                <asp:CheckBox ID="CheckBox3" runat="server" AutoPostBack="true" Text="允许排序"
                    Checked="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
            </fieldset>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
